<form name="frmEditPermission" method="POST" action="/admin/permission/doedit/type/<?php echo $this->type; ?>">
	<table border="0" width="100%" cellpadding="1" cellspacing="1">
		<tr>
			<td>User Type</td>
			<td>Modules</td>
			<td>Permission</td>
		</tr>
		<tr>
			<td colspan="3">&nbsp;</td>
		</tr>
		<?php
			foreach ($this->permission as $permission_arr) :
		?>
		<tr>
			<td valign="top"><?php echo $this->type; ?></td>
			<td>
				<table border="1"  cellpadding="1" cellspacing="1" width="90%">

				<?php 
					$cols = 3;
					$numcolsprinted  = 0;
					foreach ($this->get_modules as $key=>$module_arr) {
						if($numcolsprinted == $cols) {
							echo "</tr>\n<tr>\n";
							$numcolsprinted = 0;
						}
						$mod_arr = explode("|", $permission_arr['module']);
						if(isset($mod_arr[$key]))
						{
							echo $mod_arr[$key];
							if(ucfirst($mod_arr[$key]) == "Newsletter")
							{
								$checked = "checked";
							} else {
								$checked = "";
							}
						}
						echo "<td><input type='checkbox' name='mod_permission[]' " . $checked . " value='" . $module_arr . "' /></td><td>$module_arr</td>\n";
						$numcolsprinted++;
					}
					
					$colstobalance = $cols - $numcolsprinted;
					for ($i=1; $i<=$colstobalance; $i++) {
					
					}
					echo "<td colspan='2'></td>\n";

					
				?>
				
				</table>
			</td>
			<td valign="top"><?php echo $permission_arr['acl']; ?></td>
		</tr>
		<?php
			endforeach;
		?>
	</table>
</form>